#ifndef __BSP_SIGNAL_LED_H
#define __BSP_SIGNAL_LED_H

#include "ch32f10x.h"
#include "debug.h"
	
	// 4个IO口
#define SIGNAL_LED_RCC			RCC_APB2Periph_GPIOB
#define SIGNAL_LED_PORT  		GPIOB
#define SIGNAL_LED1_PIN			GPIO_Pin_12
#define SIGNAL_LED2_PIN			GPIO_Pin_13
#define SIGNAL_LED3_PIN			GPIO_Pin_14
#define SIGNAL_LED4_PIN			GPIO_Pin_15


 
#define SIGNAL_LED1					PBout(12)
#define SIGNAL_LED1_ON 			GPIO_SetBits(SIGNAL_LED_PORT, SIGNAL_LED1_PIN)
#define SIGNAL_LED1_OFF 		GPIO_ResetBits(SIGNAL_LED_PORT, SIGNAL_LED1_PIN)
#define SIGNAL_LED1_TOGGLE 	PBout(12) ^= (1<<0)


#define SIGNAL_LED2					PBout(13)
#define SIGNAL_LED2_ON 			GPIO_SetBits(SIGNAL_LED_PORT, SIGNAL_LED2_PIN)
#define SIGNAL_LED2_OFF 		GPIO_ResetBits(SIGNAL_LED_PORT, SIGNAL_LED2_PIN)
#define SIGNAL_LED2_TOGGLE 	PBout(13) ^= (1<<0)


#define SIGNAL_LED3					PBout(14)
#define SIGNAL_LED3_ON 			GPIO_SetBits(SIGNAL_LED_PORT, SIGNAL_LED3_PIN)
#define SIGNAL_LED3_OFF 		GPIO_ResetBits(SIGNAL_LED_PORT, SIGNAL_LED3_PIN)
#define SIGNAL_LED3_TOGGLE 	PBout(14) ^= (1<<0)


#define SIGNAL_LED4					PBout(15)
#define SIGNAL_LED4_ON 			GPIO_SetBits(SIGNAL_LED_PORT, SIGNAL_LED4_PIN)
#define SIGNAL_LED4_OFF 		GPIO_ResetBits(SIGNAL_LED_PORT, SIGNAL_LED4_PIN)
#define SIGNAL_LED4_TOGGLE 	PBout(15) ^= (1<<0)



void SIGNAL_Init(void);
void SIGNAL_SetStrength(uint8_t s);
void SIGNAL_UpdataMode(void);

#endif
